package com.lijinquan.tank;

/**
 * Created by lijinquan on 2020/8/19.
 */
public class FourFireStrategy implements FireStrategy {
    @Override
    public void fire(Tank t) {
        int bulletX = t.x + Tank.WIDTH / 2 - Bullet.WIDTH / 2;
        int bulletY = t.y + Tank.HEIGHT / 2 - Bullet.HEIGHT / 2;

        Dir[] values = Dir.values();
        for (Dir dir : values) {
            t.tankFrame.bullets.add(t.tankFrame.gameFactory.createBullet(bulletX, bulletY, dir, t.getGroup(), t.tankFrame));
        }

    }
}
